<?php
session_start(); 
if(!isset($_SESSION['userName'])){
header( 'location:../index.php' ); 
}
include("../conf/connect.php");
	$serial=$_GET['serial'];
	$dsource=$_GET['source'];
	$wsource=$_GET['wsource'];
	$rt=$_GET['rt'];
	$hid = $_SESSION['usrHHid']; 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
	<link rel="shortcut icon" href="images/favicon.ico" />
</head>
<body class="iub_back">
	<?php if($serial=='1'){ 
			$sql="SELECT hc01_1, hc01_2, hc01_3, hc01_4, hc04, hc05, hc06, hc07, hc08, hc09 FROM household_info WHERE hid='$hid'";
			$result = mysql_query($sql) or die ("problem budget_heads");
			$row = mysql_fetch_assoc($result);
		//echo "<pre>";
		//print_r($row );
	?>
	<form method="post" action="answer.php?qus=hc">
		<table align="center" class="table_border" >
			
			<tr align="left">
					<td align="left">HC01 : Sorroundings </td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc01_1'] == ''){?>bgcolor="#F7A244"<?php }?> >a. Human/Animal Waste<br />
						<input type="radio" name="hc01_01" value="1" <?php if($row['hc01_1'] == 1){?>checked="checked" <?php }?> /> 1-Yes
						<input type="radio" name="hc01_01" value="3" <?php if($row['hc01_1'] == 3){?>checked="checked" <?php }?>/> 3-No						
					</td>
			<tr align="left">
					<td align="left" <?php if($row['hc01_2'] == ''){?>bgcolor="#F7A244"<?php }?> >b. Natural Waste<br />
						<input type="radio" name="hc01_02" value="1" <?php if($row['hc01_2'] == 1){?>checked="checked" <?php }?>/> 1-Yes
						<input type="radio" name="hc01_02" value="3" <?php if($row['hc01_2'] == 3){?>checked="checked" <?php }?>/> 3-No						
		
					</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc01_3'] == ''){?>bgcolor="#F7A244"<?php }?>>c. Cowshed Nearby<br />
						<input type="radio" name="hc01_03" value="1" <?php if($row['hc01_3'] == 1){?>checked="checked" <?php }?>/> 1-Yes
						<input type="radio" name="hc01_03" value="3" <?php if($row['hc01_3'] == 3){?>checked="checked" <?php }?>/> 3-No						

					</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc01_4'] == ''){?>bgcolor="#F7A244"<?php }?>>d. Clean Compound<br />
						<input type="radio" name="hc01_04" value="1" <?php if($row['hc01_4'] == 1){?>checked="checked" <?php }?>/> 1-Yes
						<input type="radio" name="hc01_04" value="3" <?php if($row['hc01_4'] == 3){?>checked="checked" <?php }?>/> 3-No						
						
					</td>
			</tr>
			
			<tr align="left">
				<td align="left" valign="top">HC04 : No. of Rooms </td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc04'] == ''){?>bgcolor="#F7A244"<?php }?> > 
						
						<select name="r2">
						<?php
									if($row['hc04'] == ''){
									 echo "<option value='00' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['hc04'];
										/*$sql1="SELECT value from retreive_data WHERE qus='q7' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];*/
										echo "<option value='$hop' selected='selected'> $hop</option>";
									}
								?>
							<option value="0">0</option>
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<option value="6">6</option>
							<option value="7">7</option>
							<option value="8">8</option>
							<option value="9">9</option>
							<option value="9+">9+</option>
						</select>
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC05 : MBed Floor </td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc05'] == ''){?>bgcolor="#F7A244"<?php }?> >
						<select name="htype">
							<?php
									if($row['hc05'] == ''){
									 echo "<option value='00' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['hc05'];
										$sql1="SELECT value from retreive_data WHERE qus='hc05' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
							<option value="">Select</option>
							<option value="01">01-Pucca</option>
							<option value="02">02-Mud</option>
							<option value="03">03-Wood</option>
							<option value="04">04-Bamboo</option>
						</select>						 
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC06 : MBed Wall </td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc06'] == ''){?>bgcolor="#F7A244"<?php }?> >
						<select name="wall">
							<?php
									if($row['hc06'] == ''){
									 echo "<option value='00' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['hc06'];
										$sql1="SELECT value from retreive_data WHERE qus='hc06' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
							<option value="">Select</option>
							<option value="01">01-Pucca</option>
							<option value="02">02-Tin</option>
							<option value="03">03-Mud</option>
							<option value="04">04-Wood</option>
							<option value="05">05-Bamboo</option>
							<option value="06">06-Straw</option>
						</select>						 
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC07 : MBed Roof </td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc07'] == ''){?>bgcolor="#F7A244"<?php }?>>
						<select name="roof">
							<?php
									if($row['hc07'] == ''){
									 echo "<option value='00' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['hc07'];
										$sql1="SELECT value from retreive_data WHERE qus='hc07' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
							<option value="">Select</option>
							<option value="01">01-Pucca</option>
							<option value="02">02-Tin</option>
							<option value="03">03-Bamboo</option>
							<option value="04">04-Straw</option>
						</select>						 
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC08 : House Electrified?</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc08'] == ''){?>bgcolor="#F7A244"<?php }?> >
						<input type="radio" name="hcurrent" value="1" <?php if($row['hc08'] == 1){?>checked="checked" <?php }?>/> 1-Yes
						<input type="radio" name="hcurrent" value="3" <?php if($row['hc08'] == 3){?>checked="checked" <?php }?>/> 3-No
							

					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC09 : Village Electrified?</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['hc09'] == ''){?>bgcolor="#F7A244"<?php }?>>
						<input type="radio" name="vcurrent" value="1" <?php if($row['hc09'] == 1){?>checked="checked" <?php }?>/> 1-Yes
						<input type="radio" name="vcurrent" value="3" <?php if($row['hc09'] == 3){?>checked="checked" <?php }?>/> 3-No
							

					</td>
			</tr>
			
			<tr>
					<td  align="right">
						<input type="submit" value="Next" class="input-box" />&nbsp;
					</td>
			</tr>
			
		</table>
	</form>
	<?php } ?>
	<?php if ($serial=='2'){ ?>
	<form action="answer.php?qus=hc_1" method="post">
	<table align="center" class="table_border" >
		<tr align="left">
					<td align="left" valign="top"> HC02 : Living at</td>
			</tr>
			<tr align="left">
					<td align="left">
						<select name="owner">
							<option value="0">Select</option>
							<option value="1">1-Own House</option>
							<option value="2">2-Other's House</option>
							<option value="3">3-Rented House</option>
						</select>
					</td>
			</tr>
			<tr>
					<td  align="right">
						<input type="submit" value="Next" class="input-box" />&nbsp;
					</td>
			</tr>
		</table>
		</form>
	<?php } ?>
	
	<?php if ($serial=='3'){ ?>
	<form action="answer.php?qus=hc_2" method="post">
	<table align="center" class="table_border" >
		<tr align="left">
					<td align="left" valign="top"> HC03 : Rent</td>
			</tr>
			<tr align="left">
					<td align="left">
						<input type="text" name="rent1" /> BDT
						
					</td>
			</tr>
			<tr>
					<td  align="right">
						<input type="submit" value="Next" class="input-box" />&nbsp;
					</td>
			</tr>
	</table>
	</form>
	<?php } ?>
	
	<?php if ($serial=='4'){ ?>
	<form action="answer.php?qus=hc_3" method="post">
	<table align="center" class="table_border" >
		<tr align="left">
					<td align="left" valign="top"> HC10 : Drinking Water Source</td>
			</tr>
			<tr align="left">
					<td align="left">
						<select name="drink">
							<option value="00">Select</option>
							<option value="01">01-Tap</option>
							<option value="02">02-TubeWell</option>
							<option value="03">03-Well</option>
							<option value="04">04-Pond</option>
							<option value="05">05-Canal</option>
							<option value="06">06-River</option>
							<option value="07">07-Rain</option>
						</select>
					</td>
			</tr>
			<tr>
					<td  align="right">
						<input type="submit" value="Next" class="input-box" />&nbsp;
					</td>
			</tr>
			</table>
			</form>
		<?php } ?>
		<?php if ($serial=='4a'){ 
				if($dsource=='01'){
					$drink="Tap";
				}
				elseif($dsource=='02'){
					$drink="Tubewell";
				}
				elseif($dsource=='03'){
					$drink="Well";
				}
				elseif($dsource=='04'){
					$drink="Pond";
				}
				elseif($dsource=='05'){
					$drink="Canal";
				}
				elseif($dsource=='06'){
					$drink="River";
				}
				elseif($dsource=='07'){
					$drink="Rain";
				}
			
		?>
		<form action="answer.php?qus=hc_3a" method="post">
		<input type="hidden" name="dsource" value="<?php echo $dsource; ?>" />
		<table align="center" class="table_border" >
			<tr align="left">
					<td align="left" valign="top"> HC11 : Where is the <?php echo $drink;?>?</td>
			</tr>
			<tr align="left">
					<td align="left">
						<select name="pwater">
							<option value="0">Select</option>
							<option value="1">1-Inside Compound</option>
							<option value="2">2-Inside House</option>
							<option value="3">3-Outside</option>
						</select>
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC12 : Time to reach <?php echo $drink;?> :</td>
			</tr>
			<tr align="left">
					<td align="left">
						<select name="t1">
							<option value="0">0</option>
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<option value="6">6</option>
							<option value="7">7</option>
							<option value="8">8</option>
							<option value="9">9</option>
						</select> 
						<select name="t2">
							<option value="0">0</option>
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<option value="6">6</option>
							<option value="7">7</option>
							<option value="8">8</option>
							<option value="9">9</option>
						</select>&nbsp;min
					</td>
				</tr>
				<tr>
						<td  align="right">
							<input type="submit" value="Next" class="input-box" />&nbsp;
						</td>
				</tr>
			</table>
			</form>
		<?php }?>
		<?php if ($serial=='5'){ ?>
			<form action="answer.php?qus=hc_4" method="post">
			<table align="center" class="table_border" >
				<tr align="left">
						<td align="left" valign="top"> HC13 : Washing Water Source</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="washing">
								<option value="00">Select</option>
								<option value="01">01-Tap</option>
								<option value="02">02-TubeWell</option>
								<option value="03">03-Well</option>
								<option value="04">04-Pond</option>
								<option value="05">05-Canal</option>
								<option value="06">06-River</option>
								<option value="07">07-Rain</option>
							</select>
						</td>
				</tr>
				<tr>
						<td  align="right">
							<input type="submit" value="Next" class="input-box" />&nbsp;
						</td>
				</tr>
			</table>
			</form>
		<?php }?>
		<?php if ($serial=='5a'){ 
					if($wsource=='01'){
						$wash="Tap";
					}
					elseif($wsource=='02'){
						$wash="Tubewell";
					}
					elseif($wsource=='03'){
						$wash="Well";
					}
					elseif($wsource=='04'){
						$wash="Pond";
					}
					elseif($wsource=='05'){
						$wash="Canal";
					}
					elseif($wsource=='06'){
						$wash="River";
					}
					elseif($wsource=='07'){
						$wash="Rain";
					}
		?>
			<form action="answer.php?qus=hc_4a" method="post">
			<input type="hidden" name="wsource" value="<?php echo $wsource; ?>" />
			<table align="center" class="table_border" >
				<tr align="left">
					<td align="left" valign="top"> HC14 :Where is the <?php echo $wash;?></td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="wpwater">
								<option value="0">Select</option>
								<option value="1">1-Inside Compound</option>
								<option value="2">2-Inside House</option>
								<option value="3">3-Outside</option>
							</select>
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HC15 : Time to reach <?php echo $wash;?></td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="t3">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
							</select> 
							<select name="t4">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
							</select>&nbsp;min
						</td>
				</tr>
				<tr>
						<td  align="right">
							<input type="submit" value="Next" class="input-box" />&nbsp;
						</td>
				</tr>
			</table>
			</form>
		<?php }?>
		<?php if ($serial=='6'){ 
				$sql="SELECT h16, h17, h18, h19 FROM household_info WHERE hid='$hid'";
				$result = mysql_query($sql) or die ("problem budget_heads");
				$row = mysql_fetch_assoc($result);
				//echo "<pre>";
				//print_r($row );
		?>
		<form action="answer.php?qus=hc_5" method="post">
		<table align="center" class="table_border" >
			<tr align="left">
					<td align="left" valign="top"> HC16 : Main Fuel</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['h16'] == ''||$row['h16'] == '0'){?>bgcolor="#F7A244"<?php }?>>
						<select name="fuel">
							<?php
									if($row['h16'] == ''||$row['h16'] == '0'){
									 echo "<option value='0' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['h16'];
										$sql1="SELECT value from retreive_data WHERE qus='h16' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>						
							<option value="1">1-Kerosine</option>
							<option value="2">2-Charcoal</option>
							<option value="3">3-Coal</option>
							<option value="4">4-Gas</option>
							<option value="5">5-Wood</option>
							<option value="6">6-Agri. Waste</option>
							<option value="7">7-Electricity</option>
							<option value="8">8-Cow Dung</option>
							<option value="9">9-Leaf</option>
						</select>
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC17 : Cooking Area</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['h17'] == ''||$row['h17'] == '0'){?>bgcolor="#F7A244"<?php }?>>
						<select name="hc17">
							<?php
									if($row['h17'] == ''||$row['h17'] == '0'){
									 echo "<option value='0' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['h17'];
										$sql1="SELECT value from retreive_data WHERE qus='h17' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>	
							<option value="1">1-Inside House</option>
							<option value="2">2-Outside House</option>
							<option value="3">3-Both</option>
						</select>
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC18 : Kitchen has/is</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['h18'] == ''||$row['h18'] == '0'){?>bgcolor="#F7A244"<?php }?>>
						<select name="hc18">
							<?php
									if($row['h18'] == ''||$row['h18'] == '0'){
									 echo "<option value='0' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['h18'];
										$sql1="SELECT value from retreive_data WHERE qus='h18' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
							<option value="1">1-Window</option>
							<option value="2">2-Chimney</option>
							<option value="3">3-Exhaust</option>
							<option value="4">4-Connected outside</option>
						</select>
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC19 : Cooking done outside</td>
			</tr>
			<tr align="left">
					<td align="left">
						<select name="m1">
							<option value="0">0</option>
							<option value="1">1</option>
						</select>
						<select name="m2">
							<option value="0">0</option>
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<option value="6">6</option>
							<option value="7">7</option>
							<option value="8">8</option>
							<option value="9">9</option>
						</select> 
						&nbsp;month
					</td>
			</tr>
			<tr>
					<td  align="right">
						<input type="submit" value="Next" class="input-box" />&nbsp;
					</td>
			</tr>
			</table>
			</form>
			<?php } ?>
			<?php if ($serial=='7'){ 
						$sql="SELECT h20_01, h21_01, h22_01, h23_01 FROM household_info WHERE hid='$hid'";
						$result = mysql_query($sql) or die ("problem budget_heads");
						$row = mysql_fetch_assoc($result);
						//echo "<pre>";
						//print_r($row );
			?> 
			<form action="answer.php?qus=hc_6" method="post">
			<table align="center" class="table_border" >
			<tr align="left">
					<td align="left" valign="top"> HC20 : Toilet</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['h20_01'] == ''||$row['h20_01'] == '0'){?>bgcolor="#F7A244"<?php }?>>
						<select name="h20_m">
							<?php
									if($row['h20_01'] == ''||$row['h20_01'] == '0'){
									 echo "<option value='0' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['h20_01'];
										$sql1="SELECT value from retreive_data WHERE qus='h20_m' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
							<option value="1">1-Septic Latrin</option>
							<option value="2">2-Slab Latrin</option>
							<option value="3">3-Hole (Gorto)</option>
							<option value="4">4-Open Latrin</option>
							<option value="5">5-Hanging Latrin</option>
							<option value="6">6-In the Field</option>
						</select>
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC21 : Use of Sandal:</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['h21_01'] == ''){?>bgcolor="#F7A244"<?php }?>>
						<input type="radio" name="h21_m" <?php if($row['h21_01'] =='1'){?> checked="checked"<?php }?> value="1" /> 1-Yes
						<input type="radio" name="h21_m" <?php if($row['h21_01'] =='2'){?> checked="checked"<?php }?> value="2" /> 2-No							
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC22 : hand wash</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['h22_01'] == ''||$row['h22_01'] == '0'){?>bgcolor="#F7A244"<?php }?>>
						<select name="h22_m">
							<?php
									if($row['h22_01'] == ''||$row['h22_01'] == '0'){
									 echo "<option value='0' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['h22_01'];
										$sql1="SELECT value from retreive_data WHERE qus='h22_m' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
							<option value="1">1-Always</option>
							<option value="3">3-Sometimes</option>
							<option value="4">4-Never</option>
						</select>
					</td>
			</tr>
			<tr align="left">
					<td align="left" valign="top"> HC23 : Use of Soap</td>
			</tr>
			<tr align="left">
					<td align="left" <?php if($row['h23_01'] == ''||$row['h23_01'] == '0'){?>bgcolor="#F7A244"<?php }?>>
						<select name="h23_m">
							<?php
									if($row['h23_01'] == ''||$row['h23_01'] == '0'){
									 echo "<option value='0' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['h23_01'];
										$sql1="SELECT value from retreive_data WHERE qus='h23_m' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
							<option value="1">1-Always</option>
							<option value="3">3-Sometimes</option>
							<option value="4">4-Never</option>
						</select>					
					</td>
			</tr>		
			<tr>
					<td  align="right">
						<input type="submit" value="Next" class="input-box" />&nbsp;
					</td>
			</tr>
	</table>
	</form>
	<?php } ?>
	<?php if ($serial=='8'){ 
				$sql="SELECT h24, h26, h27 FROM household_info WHERE hid='$hid'";
				$result = mysql_query($sql) or die ("problem budget_heads");
				$row = mysql_fetch_assoc($result);
				//echo "<pre>";
				//print_r($row );
	?>
	<form action="answer.php?qus=hc_7" method="post">
			<table align="center" class="table_border" >
				<tr align="left">
					<td align="left" valign="top"> H24 : Washing Before Food</td>
				</tr>
				<tr align="left">
					<td align="left" <?php if($row['h24'] == ''){?>bgcolor="#F7A244"<?php }?>>
						<input type="radio" name="h24" <?php if($row['h24'] =='1'){?> checked="checked"<?php }?> value="1" /> 1-Yes
						<input type="radio" name="h24" <?php if($row['h24'] =='2'){?> checked="checked"<?php }?> value="2" /> 2-No							
					</td>
				</tr>
			
				<tr align="left">
						<td align="left" valign="top"> HC26 : Use of Soap</td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['h26'] == ''||$row['h26'] == '-1'){?>bgcolor="#F7A244"<?php }?>>
						<select name="h26">
							<?php
									if($row['h26'] == ''||$row['h26'] == '-1'){
									 echo "<option value='-1'> Select</option>";
									}
									else{
										$hop=$row['h26'];
										$sql1="SELECT value from retreive_data WHERE qus='h26' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
								<option value="1">1-Before</option>
								<option value="2">2-After</option>
								<option value="3">3-Both</option>
								<option value="0">0-Never</option>
							</select>					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HC27 : Water Purification </td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['h27'] == ''||$row['h27'] == '0'){?>bgcolor="#F7A244"<?php }?>>
						<select name="h27">
							<?php
									if($row['h27'] == ''||$row['h27'] == '0'){
									 echo "<option value='0' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['h27'];
										$sql1="SELECT value from retreive_data WHERE qus='h27' and hoption='$hop' ";
										$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
										$value = mysql_fetch_assoc($result1);
										$mv= $value['value'];
										echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
									}
								?>
								<option value="1">1-Boil</option>
								<option value="2">2-Fitkiri</option>
								<option value="3">3-Cloth Filter</option>
								<option value="4">4-Net Filter</option>
								<option value="5">5-Other Filter</option>
								<option value="6">6-No Filter</option>
							</select>					
						</td>
				</tr>
				<tr>
					<td  align="right">
						<input type="submit" value="Next" class="input-box" />&nbsp;
					</td>
			</tr>	
			</table>
	</form>
	<?php } ?>
	<?php if ($serial=='9'){ 
				$sql="SELECT h28_a_1, h28_b_1, h28_c_1 FROM household_info WHERE hid='$hid'";
				$result = mysql_query($sql) or die ("problem budget_heads");
				$row = mysql_fetch_assoc($result);
				//echo "<pre>";
				//print_r($row );
	?>
	<form action="answer.php?qus=hc_8" method="post">
			<table align="center" class="table_border" >
				<tr align="left">
						<td align="left" valign="top">During Last 1 yr Inadequate fund for:</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top">HC28a: Food(Prblm):</td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['h28_a_1'] == ''||$row['h28_a_1'] == '0'){?>bgcolor="#F7A244"<?php }?>>
						<select name="h28_a_1">
							<?php
									if($row['h28_a_1'] == ''||$row['h28_a_1'] == '0'){
									 echo "<option value='0' selected='selected'> Select</option>";
									}
									else{
										$hop=$row['h28_a_1'];
										echo "<option value='$hop' selected='selected'> $hop</option>";
									}
								?>
								<option value="Always">Always</option>
								<option value="Frequently">Frequently</option>
								<option value="Sometimes">Sometimes</option>
								<option value="Never">Never</option>
							</select>					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top">HC28b: Clothing(Prblm):</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['h28_b_1'] == ''||$row['h28_b_1'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="h28_b_1">
									 <?php
											if($row['h28_b_1'] == ''||$row['h28_b_1'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['h28_b_1'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>
										<option value="Always">Always</option>
										<option value="Frequently">Frequently</option>
										<option value="Sometimes">Sometimes</option>
										<option value="Never">Never</option>
								</select>					
							</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top">HC28c: Utility (Prblm):</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['h28_c_1'] == ''||$row['h28_c_1'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="h28_c_1">
									 <?php
											if($row['h28_c_1'] == ''||$row['h28_c_1'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['h28_c_1'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>
									<option value="Always">Always</option>
									<option value="Frequently">Frequently</option>
									<option value="Sometimes">Sometimes</option>
									<option value="Never">Never</option>
								</select>					
							</td>
				</tr>
				<tr>
						<td  align="right">
							<input type="submit" value="Next" class="input-box" />&nbsp;
						</td>
				</tr>	
			</table>
	</form>
	<?php } ?>
	<?php if ($serial=='10'){ 
			$sql="SELECT h29, h30, h31, h32 FROM household_info WHERE hid='$hid'";
				$result = mysql_query($sql) or die ("problem budget_heads");
				$row = mysql_fetch_assoc($result);
				//echo "<pre>";
				//print_r($row );
	?>
	<form action="answer.php?qus=hc_9" method="post">
			<table align="center" class="table_border" >
				<tr align="left">
						<td align="left" valign="top"> HC29 : Avg Mnthly Household Income</td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['h29'] == ''){?>bgcolor="#F7A244"<?php }?>>
							<input type="text" <?php if($row['h29'] != ''){?> value="<?php echo $row['h29'];?>" <?php } ?> name="h29" />BDT
											
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HC30 : Food Cost(Mnthly)</td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['h30'] == ''){?>bgcolor="#F7A244"<?php }?>>
							<input type="text" <?php if($row['h30'] != ''){?> value="<?php echo $row['h30'];?>" <?php } ?> name="h30" />BDT
											
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top">HC31 : Cultivable Land</td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['h31'] == ''){?>bgcolor="#F7A244"<?php }?>>
							<input type="radio" name="h31" <?php if($row['h31'] == 'Yes'){?> checked="checked" <?php } ?> value="Yes" /> Yes
							<input type="radio" name="h31" <?php if($row['h31'] == 'No'){?> checked="checked" <?php } ?>value="No" /> No	
										
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HC32 : Measure</td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['h32'] == ''){?>bgcolor="#F7A244"<?php }?>>
							<input type="text" name="h32" />	decimal				
						</td>
				</tr>
				<tr>
						<td  align="right">
							<input type="submit" value="Next" class="input-box" />&nbsp;
						</td>
				</tr>	
			</table>
	</form>
	<?php } ?>
	<?php if ($serial=='11'){ ?>
			<form action="answer.php?qus=hc_10" method="post">
			<table align="center" class="table_border" >
				<tr align="left">
						<td align="left" valign="top"> HA 01 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_1">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select>
							Motorbikes/Scooter				
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 02 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_2">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select>	Car/Zip					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 03 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_3">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select>	Tractor				
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 04 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_4">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Bi-cycle
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 05 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_5">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select>	Bull Cart					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 06 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_6">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Computer					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 07 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_7">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select>	Washing Machine					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 08 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_8">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select>	Kitchen Mixer				
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 09 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_9">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select>	Refrigerator					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 10 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_10">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Television					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 11 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_11">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Radio/ 2-in-1					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 12 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_12">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Telephone						
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 13 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_13">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Mobile Phone					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 14 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_14">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Fan					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 15 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_15">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Sewing Machine					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 16 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_16">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Watch						
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 17 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<select name="ha_17">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="9+">9+</option>
							</select> Dining Table					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 18 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<input type="text" name="ha_18" value="0" size="5"/> House(s)				
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 19 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<input type="text" name="ha_19" value="0" size="5"/> Land in village (Dec)					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 20 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<input type="text" name="ha_20" value="0" size="5"/> Land in town (Dec)					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 21 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<input type="text" name="ha_21" value="0" size="5"/>TK bond					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 22 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<input type="text" name="ha_22" value="0" size="5"/> Gold (In Bhori)					
						</td>
				</tr>
				<tr align="left">
						<td align="left" valign="top"> HA 23 :</td>
				</tr>
				<tr align="left">
						<td align="left">
							<input type="text" name="ha_23" value="0" size="5"/>Furniture (tk)				
						</td>
				</tr>
				
				<tr>
						<td  align="right">
							<input type="submit" value="Next" class="input-box" />&nbsp;
						</td>
				</tr>
			</table>
			</form>
		<?php }?>
		
		<?php if ($serial=='12'){ 
				$sql="SELECT heh01_a, heh01_b, heh01_c, heh01_d, heh01_e, heh01_f, heh01_g FROM household_economic WHERE hid='$hid'";
				$result = mysql_query($sql) or die ("problem budget_heads");
				$row = mysql_fetch_assoc($result);
				//echo "<pre>";
				//print_r($row );
		?>
				<form action="answer.php?qus=hc_11" method="post">
				<table align="center" class="table_border" >
					<tr align="left">
							<td align="left" valign="top"> Last 1 Yr. Happenings:</td>
					</tr>
					<tr align="left">
							<td align="left" valign="top">HEH01A: Death :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh01_a'] == ''||$row['heh01_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_1_a">
									 <?php
											if($row['heh01_a'] == ''||$row['heh01_a'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh01_a'];
												$sql1="SELECT value from retreive_data WHERE qus='heh01_a' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<tr align="left">
							<td align="left" valign="top">HEH01B: Illness :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh01_b'] == ''||$row['heh01_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_1_b">
									 <?php
											if($row['heh01_b'] == ''||$row['heh01_b'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh01_b'];
												$sql1="SELECT value from retreive_data WHERE qus='heh01_b' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<tr align="left">
							<td align="left" valign="top">HEH01C: Crop Loss:</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh01_c'] == ''||$row['heh01_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_1_c">
									 <?php
											if($row['heh01_c'] == ''||$row['heh01_c'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh01_c'];
												$sql1="SELECT value from retreive_data WHERE qus='heh01_c' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<tr align="left">
							<td align="left" valign="top">HEH01D: Natural Disaster :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh01_d'] == ''||$row['heh01_d'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_1_d">
									 <?php
											if($row['heh01_d'] == ''||$row['heh01_d'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh01_d'];
												$sql1="SELECT value from retreive_data WHERE qus='heh01_d' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<tr align="left">
							<td align="left" valign="top">HEH01E: Loss of job :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh01_e'] == ''||$row['heh01_e'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_1_e">
									 <?php
											if($row['heh01_e'] == ''||$row['heh01_e'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh01_e'];
												$sql1="SELECT value from retreive_data WHERE qus='heh01_e' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<tr align="left">
							<td align="left" valign="top">HEH01F: Low crop price :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh01_f'] == ''||$row['heh01_f'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_1_f">
									 <?php
											if($row['heh01_f'] == ''||$row['heh01_f'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh01_f'];
												$sql1="SELECT value from retreive_data WHERE qus='heh01_f' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>								
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<tr align="left">
							<td align="left" valign="top">HEH01G: Business Loss :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh01_g'] == ''||$row['heh01_g'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_1_g">
									 <?php
											if($row['heh01_g'] == ''||$row['heh01_g'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh01_g'];
												$sql1="SELECT value from retreive_data WHERE qus='heh01_g' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>	
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<tr>
							<td  align="right">
								<input type="submit" value="Next" class="input-box" />&nbsp;
							</td>
					</tr>	
				</table>
		</form>
		<?php } ?>
		<?php if ($serial=='13'){ 
					//print_r($_GET);
					$sql="SELECT heh02_a, heh02_b, heh02_c, heh02_d, heh02_e, heh02_f, heh02_g FROM household_economic WHERE hid='$hid'";
					$result = mysql_query($sql) or die ("problem budget_heads");
					$row = mysql_fetch_assoc($result);
					//print_r($row );
					
					$qc[0]=$_GET['a'];
					$qc[1]=$_GET['b'];
					$qc[2]=$_GET['c'];
					$qc[3]=$_GET['d'];
					$qc[4]=$_GET['e'];
					$qc[5]=$_GET['f'];
					$qc[6]=$_GET['g'];
					$bstring = "&a=$qc[0]&b=$qc[1]&c=$qc[2]&d=$qc[3]&e=$qc[4]&f=$qc[5]&g=$qc[6]";
					$chkcount=0;
					
					for($i=0;$i<7;$i++){
						if($qc[$i]=='3'){
							$chkcount++;
						}
					}
					
					if($chkcount<7){
		?>
				
				<form action="answer.php?qus=hc_12" method="post">
				<input type="hidden" value="<?php echo $bstring; ?>" name="bstring" />
				<table align="center" class="table_border" >
					<tr align="left">
							<td align="left" valign="top">Economic Hardship Causes</td>
					</tr>
					<?php 
					if($qc[0]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH02A: Death :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh02_a'] == ''||$row['heh02_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_2_a">
									 <?php
											if($row['heh02_a'] == ''||$row['heh02_a'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh02_a'];
												$sql1="SELECT value from retreive_data WHERE qus='heh02_a' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>	
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<?php 
					}
					if($qc[1]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH02B: Illness :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh02_b'] == ''||$row['heh02_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_2_b">
									 <?php
											if($row['heh02_b'] == ''||$row['heh02_b'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh02_b'];
												$sql1="SELECT value from retreive_data WHERE qus='heh02_b' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>	
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<?php 
					}
					if($qc[2]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH02C: Crop Loss:</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh02_c'] == ''||$row['heh02_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_2_c">
									 <?php
											if($row['heh02_c'] == ''||$row['heh02_c'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh02_c'];
												$sql1="SELECT value from retreive_data WHERE qus='heh02_c' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>									
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<?php 
					}
					if($qc[3]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH02D: Natural Disaster :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh02_d'] == ''||$row['heh02_d'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_2_d">
									 <?php
											if($row['heh02_d'] == ''||$row['heh02_d'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh02_d'];
												$sql1="SELECT value from retreive_data WHERE qus='heh02_d' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>	
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<?php 
					}
					if($qc[4]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH02E: Loss of job :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh02_e'] == ''||$row['heh02_e'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_2_e">
									 <?php
											if($row['heh02_e'] == ''||$row['heh02_e'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh02_e'];
												$sql1="SELECT value from retreive_data WHERE qus='heh02_e' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>									
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<?php 
					}
					if($qc[5]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH02F: Low crop price :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh02_f'] == ''||$row['heh02_f'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_2_f">
									 <?php
											if($row['heh02_f'] == ''||$row['heh02_f'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh02_f'];
												$sql1="SELECT value from retreive_data WHERE qus='heh02_f' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>	
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<?php 
					}
					if($qc[6]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH02G: Business Loss :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh02_g'] == ''||$row['heh02_g'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_2_g">
									 <?php
											if($row['heh02_g'] == ''||$row['heh02_g'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh02_g'];
												$sql1="SELECT value from retreive_data WHERE qus='heh02_g' and hoption='$hop' ";
												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");
												$value = mysql_fetch_assoc($result1);
												$mv= $value['value'];
												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";
											}
										?>	
									<option value="1">1-Yes</option>
									<option value="3">3-No</option>
								</select>					
							</td>
					</tr>
					<?php 
					}
					?>
					<tr>
							<td  align="right">
								<input type="submit" value="Next" class="input-box" />&nbsp;
							</td>
					</tr>	
				</table>
		</form>
		<?php }} ?>
		<?php if ($serial=='14'){ 
					
					$sql="SELECT heh03_a, heh03_b, heh03_c, heh03_d, heh03_e, heh03_f, heh03_g FROM household_economic WHERE hid='$hid'";
					$result = mysql_query($sql) or die ("problem budget_heads");
					$row = mysql_fetch_assoc($result);
					//print_r($row );
				//print_r($_GET);
					$qc[0]=$_GET['a'];
					$qc[1]=$_GET['b'];
					$qc[2]=$_GET['c'];
					$qc[3]=$_GET['d'];
					$qc[4]=$_GET['e'];
					$qc[5]=$_GET['f'];
					$qc[6]=$_GET['g'];
					$chkcount=0;
					$qstring = "&a=$qc[0]&b=$qc[1]&c=$qc[2]&d=$qc[3]&e=$qc[4]&f=$qc[5]&g=$qc[6]";
					for($i=0;$i<7;$i++){
						if($qc[$i]=='3'){
							$chkcount++;
						}
					}
					
					if($chkcount<7){
		?>
				<form action="answer.php?qus=hc_13" method="post">
				<table align="center" class="table_border" >
					<tr align="left">
							<td align="left" valign="top"> How long ago?</td>
					</tr>
					<input type="hidden" value="<?php echo $qstring;?>" name="qstr" />
					<?php 
					if($qc[0]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH03A Death :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh03_a'] == ''||$row['heh03_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="month_a">
									 <?php
											if($row['heh03_a'] == ''||$row['heh03_a'] == '0'){
											 echo "<option value='0' selected='selected'> 0</option>";
											}
											else{
												$hop=$row['heh03_a'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
								</select>	Months				
							</td>
					</tr>
					<?php 
					}
					if($qc[1]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH03B Illness :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh03_b'] == ''||$row['heh03_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="month_b">
									 <?php
											if($row['heh03_b'] == ''||$row['heh03_b'] == '0'){
											 echo "<option value='0' selected='selected'> 0</option>";
											}
											else{
												$hop=$row['heh03_b'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
								</select>	Months					
							</td>
					</tr>
					<?php 
					}
					if($qc[2]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH03C Crop Loss:</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh03_c'] == ''||$row['heh03_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="month_c">
									 <?php
											if($row['heh03_c'] == ''||$row['heh03_c'] == '0'){
											 echo "<option value='0' selected='selected'> 0</option>";
											}
											else{
												$hop=$row['heh03_c'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
								</select>	Months					
							</td>
					</tr>
					<?php 
					}
					if($qc[3]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH03D Natural Disaster :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh03_d'] == ''||$row['heh03_d'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="month_d">
									 <?php
											if($row['heh03_d'] == ''||$row['heh03_d'] == '0'){
											 echo "<option value='0' selected='selected'> 0</option>";
											}
											else{
												$hop=$row['heh03_d'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
								</select>	Months					
							</td>
					</tr>
					<?php 
					}
					if($qc[4]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH03E Loss of job :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh03_e'] == ''||$row['heh03_e'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="month_e">
									 <?php
											if($row['heh03_e'] == ''||$row['heh03_e'] == '0'){
											 echo "<option value='0' selected='selected'> 0</option>";
											}
											else{
												$hop=$row['heh03_e'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
								</select>	Months				
							</td>
					</tr>
					<?php 
					}
					if($qc[5]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH03F Low crop price :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh03_f'] == ''||$row['heh03_f'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="month_f">
									 <?php
											if($row['heh03_f'] == ''||$row['heh03_f'] == '0'){
											 echo "<option value='0' selected='selected'> 0</option>";
											}
											else{
												$hop=$row['heh03_f'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
								</select>	Months				
							</td>
					</tr>
					<?php 
					}
					if($qc[6]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH03G Business Loss :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh03_g'] == ''||$row['heh03_g'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="month_g">
									 <?php
											if($row['heh03_g'] == ''||$row['heh03_g'] == '0'){
											 echo "<option value='0' selected='selected'> 0</option>";
											}
											else{
												$hop=$row['heh03_g'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
								</select>	Months					
							</td>
					</tr>
					<?php 
					}
					?>
					<tr>
							<td  align="right">
								<input type="submit" value="Next" class="input-box" />&nbsp;
							</td>
					</tr>	
				</table>
		</form>
		<?php }} ?>
		<?php if ($serial=='15'){ 
					$sql="SELECT heh04_a, heh04_b, heh04_c, heh04_d, heh04_e, heh04_f, heh04_g FROM household_economic WHERE hid='$hid'";
					$result = mysql_query($sql) or die ("problem budget_heads");
					$row = mysql_fetch_assoc($result);
					//print_r($row );
		//print_r($_GET);
				$qc[0]=$_GET['a'];
					$qc[1]=$_GET['b'];
					$qc[2]=$_GET['c'];
					$qc[3]=$_GET['d'];
					$qc[4]=$_GET['e'];
					$qc[5]=$_GET['f'];
					$qc[6]=$_GET['g'];
					$chkcount=0;
					$qstring = "&a=$qc[0]&b=$qc[1]&c=$qc[2]&d=$qc[3]&e=$qc[4]&f=$qc[5]&g=$qc[6]";
					for($i=0;$i<7;$i++){
						if($qc[$i]=='3'){
							$chkcount++;
						}
					}
					
					if($chkcount<7){
		?>
				<form action="answer.php?qus=hc_14" method="post">
				<input type="hidden" value="<?=$qstring;?>" name="qstr" />
				<table align="center" class="table_border" >
					<tr align="left">
							<td align="left" valign="top"> Recovery Measures:</td>
					</tr>
					<?php 
					if($qc[0]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH04A Death :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh04_a'] == ''||$row['heh04_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_4_a">
									 <?php
											if($row['heh04_a'] == ''||$row['heh04_a'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh04_a'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
								</select>		
							</td>
					</tr>
					<?php 
					}
					if($qc[1]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH04B Illness :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh04_b'] == ''||$row['heh04_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_4_b">
									 <?php
											if($row['heh04_b'] == ''||$row['heh04_b'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh04_b'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
								</select>				
							</td>
					</tr>
					<?php 
					}
					if($qc[2]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH04C Crop Loss:</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh04_c'] == ''||$row['heh04_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_4_c">
									 <?php
											if($row['heh04_c'] == ''||$row['heh04_c'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh04_c'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
								</select>						
							</td>
					</tr>
					<?php 
					}
					if($qc[3]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH04D Natural Disaster :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh04_d'] == ''||$row['heh04_d'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_4_d">
									 <?php
											if($row['heh04_d'] == ''||$row['heh04_d'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh04_d'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
								</select>	</td>
					</tr>
					<?php 
					}
					if($qc[4]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH04E Loss of job :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh04_e'] == ''||$row['heh04_e'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_4_e">
									 <?php
											if($row['heh04_e'] == ''||$row['heh04_e'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh04_e'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
								</select>	</td>
					</tr>
					<?php 
					}
					if($qc[5]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH04F Low crop price :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh04_f'] == ''||$row['heh04_f'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_4_f">
									 <?php
											if($row['heh04_f'] == ''||$row['heh04_f'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh04_f'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
								</select>	</td>
					</tr>
					<?php 
					}
					if($qc[6]=='1'){
					?>
					<tr align="left">
							<td align="left" valign="top">HEH04G Business Loss :</td>
					</tr>
					<tr align="left">
							<td align="left" <?php if($row['heh04_g'] == ''||$row['heh04_g'] == '0'){?>bgcolor="#F7A244"<?php }?>>
								<select name="heh_4_g">
									 <?php
											if($row['heh04_g'] == ''||$row['heh04_g'] == '0'){
											 echo "<option value='0' selected='selected'> Select</option>";
											}
											else{
												$hop=$row['heh04_g'];
												echo "<option value='$hop' selected='selected'> $hop</option>";
											}
										?>	
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
								</select>				
							</td>
					</tr>
					<?php 
					}
					?>
					<tr>
							<td  align="right">
								<input type="submit" value="Next" class="input-box" />&nbsp;
							</td>
					</tr>	
				</table>
		</form>
	<?php }} ?>
    <?php if ($serial=='16'){ 
			$sql="SELECT fm1, fm2 FROM household_info WHERE hid='$hid'";
				$result = mysql_query($sql) or die ("problem budget_heads");
				$row = mysql_fetch_assoc($result);
				//echo "<pre>";
				//print_r($row );
	?>
	<form action="answer.php?qus=hc_15" method="post">
			<table align="center" class="table_border" >
				<tr align="left">
						<td align="left" valign="top"> FM01 : No. of Family Membr</td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['fm1'] == ''){?>bgcolor="#F7A244"<?php }?>>
							<input type="text" <?php if($row['fm1'] != ''){?> value="<?php echo $row['fm1'];?>" <?php } ?> name="fm1" />
											
						</td>
				</tr>
                <tr align="left">
						<td align="left" valign="top"> FM02 : No. of child</td>
				</tr>
				<tr align="left">
						<td align="left" <?php if($row['fm2'] == ''){?>bgcolor="#F7A244"<?php }?>>
							<input type="text" <?php if($row['fm2'] != ''){?> value="<?php echo $row['fm2'];?>" <?php } ?> name="fm2" />
											
						</td>
				</tr>
				<tr>
						<td  align="right">
							<input type="submit" value="Submit" class="input-box" />&nbsp;
						</td>
				</tr>	
			</table>
	</form>
	<?php } ?>

</body>
</html>